home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / reve / Makefile.dist < prev    next >
Encoding:
Makefile  |  1995-05-03  |  12.9 KB  |  363 lines

  1. #
  2. #  Makefile for Reve (an othello game).
  3. #
  4. #  @(#)Makefile.dist 1.21 91/11/07
  5. #
  6. #  Copyright (C) 1990, 1991 - Rich Burridge & Yves Gallot.
  7. #  All rights reserved.
  8. #
  9. #  Permission is granted to copy this source, for redistribution
  10. #  in source form only, provided the news headers in "substantially
  11. #  unaltered format" are retained, the introductory messages are not
  12. #  removed, and no monies are exchanged.
  13. #
  14. #  Permission is also granted to copy this source, without the
  15. #  news headers, for the purposes of making an executable copy by
  16. #  means of compilation, provided that such copy will not be used
  17. #  for the purposes of competition in any othello tournaments, without
  18. #  prior permission from the authors.
  19. #
  20. #  No responsibility is taken for any errors inherent either
  21. #  to the comments or the code of this program, but if reported
  22. #  (see README file), then an attempt will be made to fix them.
  23. #
  24. #========================================================================
  25. #
  26. #  There are various small changes needed when compiling reve on
  27. #  different systems. These have been isolated here, and should be
  28. #  uncommented if needed.
  29. #
  30. #=======================================================================
  31. #  Full pathname of the reve edge table file. This can also be overridden
  32. #  with a command line option.
  33. #
  34. EDGENAMEFILE    = $(LIBDIR)/reve.edgetable
  35. EDGENAME        = -DEDGENAME=\"$(EDGENAMEFILE)\"
  36. #-----------------------------------------------------------------------
  37. #  If you have the poll(2) system call, then uncomment the following
  38. #  definition. Note that you will also have to uncomment the NOSELECT
  39. #  definition. This is needed for SVR4 machines.
  40. #
  41. #HASPOLL         = -DHASPOLL
  42. #-----------------------------------------------------------------------
  43. #  Full pathname of the reve online help file. This can also be overridden
  44. #  with a command line option.
  45. #
  46. HELPNAMEFILE    = $(LIBDIR)/reve.help
  47. HELPNAME        = -DHELPNAME=\"$(HELPNAMEFILE)\"
  48. #-----------------------------------------------------------------------
  49. #  If your system doesn't have the getdtablesize() library call, then
  50. #  you will need to uncomment the following definition. This will be
  51. #  needed for SVR4.
  52. #
  53. #NOGETDTAB = -DNOGETDTAB
  54. #-----------------------------------------------------------------------
  55. #  Not all machines have the index() string library function. If you
  56. #  don't have this function then you should uncomment the NOINDEX
  57. #  definition below. This definition needs to be uncommented on SVR4
  58. #  machines.
  59. #
  60. #NOINDEX         = -DNOINDEX
  61. #-----------------------------------------------------------------------
  62. #  Not every version of Unix (in particular System V derivitives) has the
  63. #  select() system call. If your machine doesn't have this call, then you
  64. #  need to uncomment the following definition.
  65. #
  66. #NOSELECT        = -DNOSELECT
  67. #-----------------------------------------------------------------------
  68. #  Some machines do not have the usleep library function. If this is
  69. #  true, then you will need to uncomment this definition.
  70. #
  71. #NO_USLEEP      = -DNO_USLEEP
  72. #-----------------------------------------------------------------------
  73. #  If your machine doesn't have a definition for the timeval struct, then
  74. #  you will need to uncomment this definition. It's needed to get Reve to
  75. #  work an an AT&T UNIX PC (aka 7300 or 3b1). It is also needed for SVR4
  76. #  machines.
  77. #
  78. #NO_TIMEVAL     = -DNO_TIMEVAL
  79. #------------------------------------------------------------------------
  80. #  The utility program trans, which can create Postscript output from a
  81. #  reve game, uses a prologue file.
  82. #
  83. #  It is possible to change the location of the trans prologue file
  84. #  by uncommenting the macro definition below and setting appropriately.
  85. #  If it's not present, then a sensible default value is used.
  86. #
  87. #PROLOGUE = -DPROLOGUE=\"$(LIBDIR)\"
  88. #------------------------------------------------------------------------
  89. #  Full pathname of the reve_proc program. This can also be overridden
  90. #  with a command line option.
  91. #
  92. REVEPROCFILE  = $(LIBDIR)/reve_proc
  93. REVEPROC      = -DREVEPROC=\"$(REVEPROCFILE)\"
  94. #------------------------------------------------------------------------
  95. #  If you not running under a BSD4.3 derived system, the parameters
  96. #  to the select call are different, and this definition should be
  97. #  uncommented. You need to uncomment this for SunOS v3.x.
  98. #
  99. #SELTYPE        = -DNO_43SELECT
  100. #-----------------------------------------------------------------------
  101. #  If you are running on a system, where the second parameter to a signal
  102. #  call is a pointer to an integer function, then this definition needs
  103. #  to be uncommented.
  104. #
  105. #SIGRET         = -DINT_SIGNAL
  106. #-----------------------------------------------------------------------
  107. #  If you are running on a 80286 machine, Microport's 5.2 port of SYSV,
  108. #  SVAT, or Xenix286, then you will need to uncomment this definition.
  109. #  This ought to work under 5.3 as well.
  110. #
  111. #  If you are building reve on an SVR4 machine, then you should also
  112. #  uncomment this definition.
  113. #
  114. #SYSV  = -DSYSV
  115. #-----------------------------------------------------------------------
  116. #  If you are trying to build reve on an SVR4 machine, then you should
  117. #  uncomment the following entry, and set SVR4LIBS to the list of SVR4
  118. #  specific libraries needed to link reve.
  119. #
  120. #SVR4LIBS     = -lnsl -lsocket -lgen
  121. #-----------------------------------------------------------------------
  122. #  If you are compiling the X11 version under MIT X11R3, you will need to
  123. #  uncomment the following definition:
  124. #
  125. #X11R3 = -DX11R3
  126. #-----------------------------------------------------------------------
  127. #  If you are compiling the X11 version and the X11 include and
  128. #  library files are not in a standard place, then the following
  129. #  two lines should be uncommented, and set appropriately.
  130. #
  131. #X11INCDIR         = -I$(OPENWINHOME)/include
  132. #X11LIBDIR         = -L$(OPENWINHOME)/lib
  133. #------------------------------------------------------------------------
  134. #  If you are compiling the XView version, then the following two lines
  135. #  should be uncommented, and set appropriately.
  136. #
  137. #XVIEWINCDIR      = -I$(OPENWINHOME)/include -DXVIEW
  138. #XVIEWLIBDIR      = -L$(OPENWINHOME)/lib
  139. #
  140. #===========================================================================
  141. #
  142. #  Default locations where Othello files will be installed.
  143. #  You might wish to alter these values.
  144. #
  145. BINDIR          = /usr/local/games
  146. LIBDIR          = /usr/local/lib
  147. MANDIR          = /usr/man/man$(MANSECT)
  148. MANSECT         = l
  149. #
  150. #  Options for submakes
  151. #
  152. MAKEOPTS        = $(MFLAGS) BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) \
  153.                             MANDIR=$(MANDIR) PROLOGUE='$(PROLOGUE)'
  154. #
  155. #  Compilation flags and standard macro definitions.
  156. #
  157. CDEFS           = $(EDGENAME) $(HASPOLL) $(HELPNAME) $(NOGETDTAB) $(NOINDEX) \
  158.           $(NOSELECT) $(NO_USLEEP) $(NO_TIMEVAL) $(REVEPROC) \
  159.           $(SELTYPE) $(SIGRET) $(SYSV) $(X11R3) $(X11INCDIR) \
  160.           $(XVIEWINCDIR)
  161. CFLAGS          = -O $(CDEFS)
  162. #
  163. #==========================================================================
  164.  
  165. .KEEP_STATE:
  166.  
  167. BINARIES        = sv_reve tty_reve xreve xv_reve
  168. ETABLE        = reve.edgetable
  169. HFILE        = reve.help
  170.  
  171. CC              = cc
  172.  
  173. REVESRCS        = reve_proc.c rev_eval.c rev_ip.c rev_iycp.c
  174. REVEDSRCS       = in.reved.c
  175. STDSRCS         = boardstuff.c events.c get.c items.c makemove.c \
  176.           main.c procs.c socket.c
  177. REVEOBJS        = reve_proc.o rev_eval.o rev_ip.o rev_iycp.o
  178. REVEDOBJS       = in.reved.o
  179. STDOBJS         = boardstuff.o events.o get.o items.o makemove.o \
  180.           main.o procs.o socket.o
  181.  
  182. GSRCS           = reve_ui.c sunview.c tty.c x11.c xview.c
  183. HDRS            = color.h ctl.h extern.h images.h reve.h patchlevel.h reve_ui.h
  184. IDIR        = images
  185. IMAGES          = $(IDIR)/black.xbm \
  186.           $(IDIR)/reve.xbm \
  187.           $(IDIR)/white.xbm \
  188.           $(IDIR)/Ibutton.xbm \
  189.           $(IDIR)/Nbutton.xbm \
  190.           $(IDIR)/Sbutton.xbm \
  191.           $(IDIR)/Ncycle.xbm \
  192.           $(IDIR)/Lcycle.xbm \
  193.           $(IDIR)/Rcycle.xbm \
  194.           $(IDIR)/Scycle.xbm \
  195.           $(IDIR)/Sch_off.xbm \
  196.           $(IDIR)/Sch_on.xbm \
  197.           $(IDIR)/hglass.xbm \
  198.           $(IDIR)/move.xbm \
  199.           $(IDIR)/nocur.xbm \
  200.           $(IDIR)/suggest.xbm
  201. TDIR        = trans
  202. TFILES        = $(TDIR)/Makefile \
  203.           $(TDIR)/README \
  204.           $(TDIR)/trans.c \
  205.           $(TDIR)/trans.ps \
  206.           $(TDIR)/trans.man \
  207.           $(TDIR)/trans.man.text
  208.  
  209. OTHERS          = CHANGES CHANGES.v1-1 README TODO reve.man MANIFEST FILES \
  210.           reve.man.text Makefile.dist
  211.  
  212. SFILES1        = get.c in.reved.c socket.c
  213. SFILES2        = makemove.c main.c
  214. SFILES3        = events.c procs.c
  215. SFILES4        = items.c reve_proc.c Reve.ad
  216. SFILES5        = rev_eval.c rev_ip.c rev_iycp.c
  217. SFILES6        = boardstuff.c $(HDRS)
  218. SFILES7        = CHANGES CHANGES.v1-1
  219. SFILES8        = reve.man reve.man.text
  220. SFILES9        = README TODO MANIFEST FILES Makefile.dist
  221. SFILES10    = sunview.c tty.c
  222. SFILES11    = x11.c
  223. SFILES12    = reve_ui.c xview.c
  224. SFILES13    = $(IDIR) Imakefile
  225. SFILES14    = reve.edge1
  226. SFILES15    = reve.edge2
  227. SFILES16    = $(TDIR)
  228. SFILES17    = reve.G
  229.  
  230. SVIEWLIBS       = -lsuntool -lsunwindow -lpixrect
  231. TTYLIBS         = -ltermcap
  232. X11LIBS         = -lX11
  233. XVIEWLIBS       = -lxview -lolgx -lX11
  234.  
  235. help:
  236.         @echo
  237.         @echo "You need to specify one of the following options:"
  238.         @echo
  239.         @echo "  make sunview    - to make the SunView version."
  240.         @echo "  make tty        - to make the dumb tty version."
  241.         @echo "  make x11        - to make the X11 version."
  242.         @echo "  make xview      - to make the XView version."
  243.         @echo
  244.         @echo "This should be followed by:"
  245.         @echo
  246.         @echo "  make install"
  247.         @echo "  make clean"
  248.         @echo
  249.  
  250. all:            $(BINARIES)
  251.  
  252. in_reved:    $(REVEDOBJS)
  253.         $(CC) -o in.reved $(CFLAGS) $(REVEDOBJS)
  254.  
  255. reve_proc:      $(REVEOBJS)
  256.         $(CC) -o reve_proc $(CFLAGS) $(REVEOBJS)
  257.  
  258. sunview:        $(STDOBJS) sunview.o in_reved reve_proc
  259.         $(CC) -o sv_reve $(CFLAGS) $(STDOBJS) sunview.o $(SVIEWLIBS)
  260.         (cd $(TDIR); $(MAKE) $(MAKEOPTS))
  261.         -cp sv_reve reve
  262.  
  263. tty:            $(STDOBJS) tty.o in_reved reve_proc
  264.         $(CC) -o tty_reve $(CFLAGS) $(STDOBJS) tty.o $(TTYLIBS)
  265.         (cd $(TDIR); $(MAKE) $(MAKEOPTS))
  266.         -cp tty_reve reve
  267.  
  268. x11:            $(STDOBJS) x11.o in_reved reve_proc
  269.         $(CC) -o xreve $(X11LIBDIR) $(CFLAGS) $(STDOBJS) \
  270.                 x11.o $(X11LIBS) $(SVR4LIBS)
  271.         (cd $(TDIR); $(MAKE) $(MAKEOPTS))
  272.         -cp xreve reve
  273.  
  274. xview:          $(STDOBJS) reve_ui.o xview.o in_reved reve_proc
  275.         $(CC) -o xv_reve $(XVIEWLIBDIR) $(CFLAGS) $(STDOBJS) \
  276.                 reve_ui.o xview.o $(XVIEWLIBS) $(SVR4LIBS)
  277.         (cd $(TDIR); $(MAKE) $(MAKEOPTS))
  278.         -cp xv_reve reve
  279.  
  280. install:
  281.         -cp reve $(BINDIR)
  282.         -chmod 751 $(BINDIR)/reve
  283.         -strip $(BINDIR)/reve
  284.         -cp reve_proc $(REVEPROCFILE)
  285.         -chmod 751 $(REVEPROCFILE)
  286.         -strip $(REVEPROCFILE)
  287.         -cp in.reved $(LIBDIR)
  288.         -chmod 751 $(BINDIR)/in.reved
  289.         -strip $(BINDIR)/in.reved
  290.         -cat reve.edge1 reve.edge2 > $(ETABLE)
  291.         -cp $(ETABLE) $(LIBDIR)
  292.         -chmod 644 $(LIBDIR)/$(ETABLE)
  293.         -cp reve.man.text $(LIBDIR)/$(HFILE)
  294.         -chmod 644 $(LIBDIR)/$(HFILE)
  295.         -cp reve.man $(MANDIR)/reve.$(MANSECT)
  296.         -chmod 644 $(MANDIR)/reve.$(MANSECT)
  297.         (cd $(TDIR); $(MAKE) $(MAKEOPTS) install)
  298.  
  299. clean:
  300.         rm -f *.o *.Z *.uu Part* *~ \
  301.             in.reved reve reve_proc $(BINARIES) core
  302.         (cd $(TDIR); $(MAKE) $(MAKEOPTS) clean)
  303.  
  304. lint:        lint-sunview lint-tty lint-xview lint-x11
  305. lint-reve:
  306.         lint $(CDEFS) $(REVESRCS)
  307. lint-sunview:   lint-reve
  308.         lint $(CDEFS) $(STDSRCS) sunview.c $(SVIEWLIBS)
  309. lint-tty:       lint-reve
  310.         lint $(CDEFS) $(STDSRCS) tty.c $(TTYLIBS)
  311. lint-xview:     lint-reve
  312.         lint $(CDEFS) $(STDSRCS) xview.c $(XVIEWLIBS)
  313. lint-x11:       lint-reve
  314.         lint $(CDEFS) $(STDSRCS) x11.c $(X11LIBS) 
  315.  
  316. saber:        $(STDSRCS) x11.c
  317.         #load $(LDFLAGS) $(CDEFS) $(STDSRCS) x11.c $(X11LIBS)
  318.  
  319. shar:;          shar.script $(SFILES1)  > reve.part1
  320.         shar.script $(SFILES2)  > reve.part2
  321.         shar.script $(SFILES3)  > reve.part3
  322.         shar.script $(SFILES4)  > reve.part4
  323.         shar.script $(SFILES5)  > reve.part5
  324.         shar.script $(SFILES6)  > reve.part6
  325.         shar.script $(SFILES7)  > reve.part7
  326.         shar.script $(SFILES8)  > reve.part8
  327.         shar.script $(SFILES9)  > reve.part9
  328.         shar.script $(SFILES10) > reve.part10
  329.         shar.script $(SFILES11) > reve.part11
  330.         shar.script $(SFILES12) > reve.part12
  331.         shar.script $(SFILES13) > reve.part13
  332.         shar.script $(SFILES14) > reve.part14
  333.         shar.script $(SFILES15) > reve.part15
  334.         shar.script $(SFILES16) > reve.part16
  335.         shar.script $(SFILES17) > reve.part17
  336.  
  337. create:         SCCS
  338.         -sccs create $(STDSRCS) $(REVESRCS) items.c reve_proc.c \
  339.                  $(GSRCS) $(HDRS) $(IMAGES) $(OTHERS)
  340.  
  341. SCCS:
  342.         mkdir SCCS
  343.         chmod 755 SCCS
  344.  
  345. boardstuff.o:   boardstuff.c color.h reve.h extern.h
  346. events.o:       events.c reve.h color.h extern.h
  347. get.o:          get.c reve.h extern.h
  348. in.reved.o:     in.reved.c reve.h ctl.h
  349. items.o:        items.c color.h reve.h extern.h
  350. makemove.o:     makemove.c reve.h extern.h
  351. main.o:         main.c reve.h color.h patchlevel.h
  352. procs.o:        procs.c color.h reve.h extern.h
  353. rev_eval.o:     rev_eval.c reve.h
  354. rev_ip.o:       rev_ip.c reve.h
  355. rev_iycp.o:     rev_iycp.c reve.h
  356. reve_proc.o:    reve_proc.c reve.h
  357. reve_ui.o:      reve_ui.c reve_ui.h
  358. socket.o:       socket.c reve.h extern.h ctl.h
  359. sunview.o:      sunview.c reve.h color.h extern.h images.h $(IMAGES)
  360. tty.o:          tty.c reve.h color.h extern.h
  361. x11.o:          x11.c reve.h color.h extern.h images.h $(IMAGES)
  362. xview.o:        xview.c reve.h color.h extern.h images.h $(IMAGES)
  363.